#ifndef __CFG_DEF_H__
#define __CFG_DEF_H__

#include <stdint.h>

#define MAX_APP_NUM (8)

typedef struct{
	struct{
		uint8_t app_select; // 0~7: app0~app7 8:USE "IO1"  9:USE "IO1+IO2" 10:USE "IO1+IO2+IO3"   other: undefined
		uint8_t app_io[3];  // 0~15: gpio0.0~gpio0.15;IO0 IO1 IO2。0bIO2IO1IO0
	};
	struct{
		uint32_t enable;
		uint32_t addr;
	}app_info[MAX_APP_NUM]; // cfg_opt时 此配置项不会生效
}app_select_cfg_t;

typedef struct{
	union{
	uint32_t         sn;               // cfg_opt 时流水号
	uint32_t         boot_flag;        // cfg_sys 时启动标志
	};
	app_select_cfg_t app_select_cfg;   // 17*4
	
	uint16_t         app_cfg_inner;    // 0-outer 【app】 1-[app]
	uint16_t         opt_cfg_id;       // 0~7

	uint16_t         crcLen1;
	uint16_t         crcVal1;
}sys_cfg_t;

#endif
